import axios from "../axios";
const method = {
  //查询子项目或父项目
  queryParentOrSub: async function(params) {
    return await axios({
      method: "get",
      url: "/projInformation/getParentOrSub?searchKey=" + params
      // params: params
    });
  },
  //获取项目树形结构
  getProjInformationTree: async function() {
    return await axios({
      method: "get",
      url: "/projInformation/getPrjTree"
      // params: params
    });
  },
  //获取所有设备信息列表
  getDeviceList: async function() {
    return await axios({
      method: "get",
      url: "/device/getDeviceAll"
      // params: params
    });
  },
  //获取某一个子项目的所有设备信息列表,及在线离线设备数量
  findDeviceAllOneSubPrj: async function(param) {
    return await axios({
      method: "get",
      url: "/device/getDeviceAndNumByProjectCode/" + param
      // params: params
    });
  },
  //获取天气水文信息
  getWeatherNow: async function(param) {
    return await axios({
      method: "post",
      url: "/greenSite/weather/getTodayWeather/" + param
      // params: params
    });
  },
  //根据城市名称获取天气水文信息
  getWeatherByCity: async function(param) {
    return await axios({
      method: "post",
      url: "/greenSite/weather/getWeatherByCity/" + param
      // params: params
    });
  },
};

const  queryParentOrSub = method. queryParentOrSub;
const  getProjInformationTree = method. getProjInformationTree;
const  getDeviceList = method. getDeviceList;
const  findDeviceAllOneSubPrj = method. findDeviceAllOneSubPrj;
const  getWeatherNow = method. getWeatherNow;
const  getWeatherByCity = method. getWeatherByCity;

export {

  queryParentOrSub,
  getProjInformationTree,
  getDeviceList,
  findDeviceAllOneSubPrj,
  getWeatherNow,
  getWeatherByCity
};
